<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
		<link rel="stylesheet" href="$!rc.contextPath/common/weui.min.css">
		<link rel="stylesheet" href="$!rc.contextPath/common/jquery-weui.min.css">
		<link rel="stylesheet" href="$!rc.contextPath/common/common.css">
		<link rel="stylesheet" href="$!rc.contextPath/css/pay.css">
		<title>支付</title>
	</head>
	<body>
	<div class="title">
		<a onClick="javascript:window.history.go(-1)"> < </a>
		支付
	</div>	
	<form onsubmit="return false;">
		#foreach($sku in $list)
		<div class="shopping-cart">
			<div class="pay-con">
				<div class="pay-con-img" onclick="javascript:window.location.href='$!rc.contextPath/skuView/detail?skuId=$!sku.sku_id'">
					<img src="$!rc.contextPath/$!sku.attach_path" class="img-responsive" alt="" />
				</div>
				<div>
					<div class="pay-infor" onclick="javascript:window.location.href='$!rc.contextPath/skuView/detail?skuId=$!sku.sku_id'">$!sku.sku_name</div>
					<div class="count">
						<span>购买份数：</span>
						<div>
							<span class="minus">-</span>
							<span class="num" val="$!sku.sku_price" did="$!sku.osc_detail_id">$!sku.sku_amount</span>
							<span class="plus">+</span>
						</div>
					</div>
				</div>
			</div>
			<p class="price">价格：<span>￥$!sku.sku_fee</span></p>
		</div>
		#end
		<div class="total">
			需要支付: <span id="payMoney">$!payMoney</span>
		</div>
		
		<input type="button" value="安全支付" class="confirm" onclick="f_pay();" />
	</form>
	<!-- <div class="confirm-bg">	
		<div class="confirm-con">
			<p class="confirm-title">很抱歉、付款失败</p>
				<div class="yes">我知道了</div>
		</div>
	</div> -->
	<div id="ajaxNav">
		
	</div>
	</body>
	<script src="$!rc.contextPath/common/jquery-1.8.3.min.js"></script>
	<script src="$!rc.contextPath/js/pay.js"></script>
	<script type="text/javascript">
		function f_pay(){
			
			var payMoney = $("#payMoney").text().replace("¥", "");
			var ids = '$!ids';
			var storeId = sessionStorage.getItem('storeId');
			
			window.location.href="$!rc.contextPath/WXJsPay?payMoney=" + payMoney + "&ids=" + ids + "&storeId=" + storeId;
		}
		
		function f_edit(cnt, id){
			$.ajax({
                type: 'POST',
                url: '$!rc.contextPath/sku/updateShopCartDetail',
                data : {
                	cnt : cnt,
                	id : id
                },
                dataType: 'json',
                success: function(data){
                	console.log(data);
                	
                	if(data.code != '0'){
                		alert(data.text);
                	}
                }
            });
		}
	</script>
</html>
